package com.hutianao.gqgl.information.futuresPrice.control;

import com.hutianao.gqgl.information.futuresPrice.entity.SearchPriceEntity;
import com.hutianao.gqgl.information.futuresPrice.service.PriceService;
import com.hutianao.gqgl.mybatis.entity.FuturesPriceEntity;
import com.hutianao.gqgl.mybatis.flexigrid.PaddingEntity;
import com.hutianao.gqgl.mybatis.flexigrid.PadingRstType;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("/information/futuresPrice")
public class PriceController {
    private Logger logger = LogManager.getLogger(this.getClass());
    @Resource
    private PriceService priceService;

    @RequestMapping("/informationPage")
    public String informationPage(){
        return "information/futuresPrice/informationPage";
    }

    @RequestMapping("/queryPriceInfoListByPage")
    @ResponseBody
    public PadingRstType<FuturesPriceEntity> queryPriceInfoListByPage(SearchPriceEntity search, PaddingEntity padding){
        logger.info(search);
        logger.info(padding);
        PadingRstType<FuturesPriceEntity> padingRstType = priceService.queryPriceInfoListByPage(search,padding);

        return padingRstType;
    }
//    queryBspiInfoListByPage

}
